<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width = 320" />
<meta name="viewport" content="initial-scale=0.5, user-scalable=no" />
<script type="text/javascript" src="<%=basePath%>javascript/jquery/jquery.js"></script>
<title><s:text name="page.title.request_detail"/></title>
<link rel="stylesheet" type="text/css" href="../stylesheet/style.css"/>
</head>

<body>
<div id="container">
    Show
</div>
<s:if test="request.requestType=='ask_question'||request.requestType=='answer_question'">
<script>
	$.ajax({
	type: "post",
    dataType: "json",
    url : '<%=basePath%>question/get_question_ajax',
    data: "questionId="+<s:if test="request.requestType=='ask_question'"><s:property value="request.requestId"/></s:if><s:else><s:property value="request.request"/></s:else>,
    success: function(data){
    	if(data==null){return;}
			document.getElementById('questionTitle').innerHTML=data.title;
			document.getElementById('questionDetail').innerHTML=data.detail;
			document.getElementById('questionTags').innerHTML='';
			for(var i=0;i<data.tags.length;i++){
				document.getElementById('questionTags').innerHTML+='<span class="grayback">'+data.tags[i].name+'</span>&nbsp;';
			}
		}
	});
</script>
</s:if>
</body>
</html>
